{extend name="base" /}

{block name="css"}

<link rel="stylesheet" href="__CSS__/style-play.css">
{/block}

{block name="js"}

<script type="text/javascript" src="__JS__/jquery.min1.10.2.js"></script>

<script src="__JS__/pinterest_grid.js"></script>


{/block}
{block name="script"}



<script type="text/javascript">
    $(function (){

        var slid = $('ul.slide_box li'),controls = $('ul.bx-controls a');
        slid.addClass('none');
        slid.eq(0).removeClass('none');

        var slideindex = 0;
        function switchi() {
            if(slideindex == slid.length - 1){
                slideindex = 0;
            }else {
                slideindex = slideindex + 1;
            }
            slid.addClass('none');
            slid.eq(slideindex).removeClass('none');
            controls.removeClass('actives');
            controls.eq(slideindex).addClass('actives');
        }

        var timer = setInterval(switchi, 3000);

        function options(indexs) {
            slid.addClass('none');
            slid.eq(indexs).removeClass('none');
            controls.removeClass('actives');
            controls.eq(indexs).addClass('actives');
        }

        $('a.options').click(function(){
            var drec = $(this).data('drec');
            if(drec == 'pre') {
                if(slideindex == 0) {
                    slideindex = 4;
                }else {
                    slideindex = slideindex - 1;
                }
            }else {
                if(slideindex == 4) {
                    slideindex = 0;
                }else {
                    slideindex = slideindex + 1;
                }
            }
            clearInterval(timer);
            options(slideindex);
            timer = setInterval(switchi, 3000);
        });

        $('ul.bx-controls li').hover(function(){
            slideindex = $(this).index();
            clearInterval(timer);
            options(slideindex);
        },function(){
            timer = setInterval(switchi, 3000);
        });

    })

    function clickTop(type){
        var sort = $("#sort").val();
//        alert(sort);
        window.location.href = "__ROOT__/index/index/type?type="+type+"&sort="+sort;
    }

    function clickDown(type){
        var sort = $("#sort").val();
//        alert('down');
        window.location.href = "__ROOT__/index/index/type?type="+type+"&sort="+sort;
    }
</script>


<script type="text/javascript">
    $(function(){
        $("#gallery-wrapper").pinterest_grid({
            no_columns: 5,
            padding_x: 14,
            padding_y: 14,
            margin_bottom: 50,
            single_column_breakpoint: 700
        });

    });
</script>


{/block}

{block name="body"}
<!--轮播图-->

<center>
    <div class="lunbo">
    <div class="top_slide_wrap">
        <div class="bx-wrapper" >
            <ul class="slide_box">
                {foreach name="play_datas" item="play_data"}
                <li>
                    <a href="{:url('index/index/detail',['id'=>$play_data['link']])}">
                        <img src="{$play_data.image}" alt="{$play_data.description}" />
                        </a>
                </li>
                {/foreach}
            </ul>
            <ul class="bx-controls" >
                {foreach name="play_datas" item="play_data"}
                <li>
                    <a class="actives" href="{:url('index/index/detail',['id'=>$play_data['link']])}">

                        <img src="{$play_data.image}" alt="{$play_data.description}" />

                        <span></span>
                        <p></p>
                    </a>
                </li>
                {/foreach}
            </ul>
        </div>
        <a class="options pre" href="javascript:;" data-drec="pre"><img src="__STATIC__/images/icons_01.png" alt=""><i class="pre"></i></a>
        <a class="options next" href="javascript:;" data-drex="next"><img src="__STATIC__/images/icons_03.png" alt=""><i class="next"></i></a>
    </div>

    </div>


</center>


<!--content-->


<div class="main">
    <div class="mainbox">

        <div class="title">
            <h1>美女图片推荐</h1>
        </div>

    </div>
</div>
<!--seach-->
<form action="__ROOT__/index/index/search" method="get">
    <div style="width: 100%; background-color: #f8f8f8;">
        <div style="border-bottom: 1px solid #ccc; border-top:1px solid #ccc;width: 1200px;padding: 10px; margin: 0 auto;display: block;">

                <div style="margin-right: 5px;float: left;margin-left: 30px; border-bottom: 1px solid rgb(169,169,169);border-top:1px solid rgb(169,169,169)">
                    <label style="margin-right: 20px;">排序</label>
                    <select name="sort" id="sort" style="margin-right: 9px; height: 40px; border: none;background-color: #f8f8f8;">
                        <option  value="1">最新排序</option>
                        <option value="2">热门排序</option>
                    </select>
                    <a href="javascript:void(0);" onclick="clickTop('DESC')">↑</a>
                    <a href="javascript:void(0);" onclick="clickDown('ASC')">↓</a>
                    <input type="submit" value="确认" style="margin-left: 9px; height: 40px;background-color: #f8f8f8;
                                                                    border:none;" >
                </div>
            <div style="margin-right: 5px;float:right;margin-right: 30px; position: relative">
                <input style="padding-left:5px;height: 40px; width: 480px; background:rgba(0,0,0,.1); border:#fff;" type="text" name="keyword" placeholder="搜索请输入模特名" />
                <img style="width: 25px; position: absolute; right: 18px; top: 7px; cursor: pointer;" src="__STATIC__/images/search.png" alt=""/>

            </div>
            <div style="clear: both;"></div>
        </div>
    </div>
</form>


<div style="background-color: #f8f8f8; width: 100%;height: 50px;"></div>
<div class="content-01">
    <section id="gallery-wrapper">
        {foreach name="results" item="result"}
        <article class="white-panel">

            <a href="{:url('index/index/detail',['id'=>$result['id']])}" target="_blank">
                <img class="thumb" src="{$result.thumb}" alt="">
                <h2>{$result.author}</h2>
                <div class="text-00">
                    <h3>{$result.title}</h3>
                </div>
            </a>
        </article>
        {/foreach}

    </section>
    <div style="text-align: center;padding-top: 30px;padding-bottom: 30px;">{$results->render()}</div>
</div>






{/block}
